package com.dark;

import facebook4j.*;

/**
 * Created by tengxue on 16-4-21.
 */
public class FaceBookTest {
    public static void main(String[] args)throws Exception{
        Facebook facebook = new FacebookFactory().getInstance();
        User me=facebook.getMe();
        ResponseList<Post> postResponseList=facebook.getPosts(me.getId());
        for (Post p: postResponseList) {
            System.out.println("\t" + p.getMessage());
        }
//        facebook.postStatusMessage("Hello World from Facebook4J.");
        facebook.getHome();
        ResponseList<Friend> friends = facebook.getFriends(me.getId());
        System.out.println("the feeds size:"+friends.size());
        for (Friend f : friends) {
            System.out.println(f.getName());
            ResponseList<Post> statuses = facebook.getStatuses(f.getId());
            for (Post p: statuses) {
                System.out.println("\t" + p.getMessage());
            }
        }

    }
}
